package bavaria.hightech.banking.b2b;

import java.util.HashMap;
import java.util.Map;

public class BankRegistry {

	private static BankRegistry bankRegistry = null;

	private Map<String, B2B> banks = new HashMap<String, B2B>();

	private BankRegistry() {

	}

	public void bind(String name, B2B bank) {
		banks.put(name, bank);
	}

	public B2B lookup(String name) {
		return banks.get(name);
	}

	public static BankRegistry getInstance() {
		if (bankRegistry == null) {
			bankRegistry = new BankRegistry();
		}
		return bankRegistry;
	}
}
